package org.openrbac.rbac.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.openrbac.rbac.entity.Image;
import org.openrbac.rbac.mapper.ImageMapper;
import org.openrbac.rbac.service.ImageService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 梁富贵
* &#064;description  针对表【image】的数据库操作Service实现
* &#064;createDate  2024-05-06 19:39:11
 */
@Service
public class ImageServiceImpl extends ServiceImpl<ImageMapper, Image>
    implements ImageService{


    public IPage<Image> getImages(Integer num) {
        QueryWrapper<Image> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type","activity");
        Page<Image> page = new Page<>(1, num);

        return this.baseMapper.selectPage(page, queryWrapper);
    }


    @Override
    public List<Image> getImages(String type) {
        List<Image> list = this.baseMapper.getImagesShowByType(type);
        return list;
    }

    @Override
    public List<Image> getRecommandGoods(List<Integer> ids) {
        return this.baseMapper.getRecommandImg(ids);
    }


}




